const express = require("express");
const cors = require("cors");
const path = require("path");

const app = express();

app.use(cors());
app.use(express.urlencoded({ extended: false }));

app.listen(3000, () => {
    console.log("ok");
});

// ------------------------ 加载路由模块 --------------------
let books = require(path.join(__dirname, "routers", "books"));
app.use("/api", books);